package com.library.Publish.service.impl;

import com.library.Publish.mapper.PublishMapper;
import com.library.Publish.model.Publish;
import com.library.Publish.model.PublishExample;
import com.library.Publish.service.PublishService;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PublishServiceImpl implements PublishService {
    
    private PublishMapper publishMapper;

    //通过构造函数注入mapper
    @Autowired
    public PublishServiceImpl(PublishMapper publishMapper) {
        this.publishMapper = publishMapper;
    }

    public long countByExample(PublishExample example) {
        return publishMapper.countByExample(example);
    }

    public int deleteByExample(PublishExample example) {
        return publishMapper.deleteByExample(example);
    }

    public int deleteByPrimaryKey(Integer id) {
        return publishMapper.deleteByPrimaryKey(id);
    }

    public int insert(Publish record) {
        return publishMapper.insert(record);
    }

    public int insertSelective(Publish record) {
        return publishMapper.insertSelective(record);
    }

    public List<Publish> selectByExample(PublishExample example) {
        return publishMapper.selectByExample(example);
    }

    public Publish selectByPrimaryKey(Integer id) {
        return publishMapper.selectByPrimaryKey(id);
    }

    public int updateByExampleSelective(@Param("record") Publish record, @Param("example") PublishExample example) {
        return publishMapper.updateByExampleSelective(record, example);
    }

    public int updateByExample(@Param("record") Publish record, @Param("example") PublishExample example) {
        return publishMapper.updateByExample(record, example);
    }

    public int updateByPrimaryKeySelective(Publish record) {
        return publishMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(Publish record) {
        return publishMapper.updateByPrimaryKey(record);
    }
}